﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace QD.Validate
{
    public class ValidateRules
    {
        public static readonly IValidateRule<String> Email = null;
        public static readonly IValidateRule<String> Url = null;
        public static readonly IValidateRule<String> USTEL = null;
        public static readonly IValidateRule<String> Require = null;
        public static readonly IValidateRule<String> IP = null;


        static ValidateRules()
        {
            Email = new RegexRule()
            {
                IngoreCase = true,
                Expression = @"^[\w\.]+([-]\w+)*@[A-Za-z0-9-_]+[\.][A-Za-z0-9-_]"
                ,
                Tips = "Email Format Error"
            };

            Url = new RegexRule()
            {
                IngoreCase = true,
                Expression = @"http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?"
                ,
                Tips = "Url Format Error"
            };

            USTEL = new RegexRule()
            {
                IngoreCase = true,
                Expression = @"^\d{3}-?\d{3}-?\d{4}?$"
                ,
                Tips = "Url Format Error"
            };

            Require = new RegexRule()
            {
                IngoreCase = true,
                Expression = @"\."
                ,
                Tips = "This field can not empty."
            };

            IP = new RegexRule()
            {
                IngoreCase = true,
                Expression = @"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$"
                ,
                Tips = "Ip format Error"
            };


        }

    }
}
